/**
 * 员工信息添加视图
 */

Ext.define("app.view.staff.Add",{
	extend:'Ext.window.Window',
	alias:'widget.staffadd',
	store:'AddStore',
	modal : true,
	width:340,
	//height:600,
	border:0,
	//layout : 'form',
	title:'员工信息添加',
	items:{
		
		xtype:'form',
		//layout:'column',
		defaultType:'textfield',
		defaults:{		//表单默认属性
			labelSeparator : ": ",
			labelWidth : 80,
			width : 260,
			//allowBlank : false,	//表单不为空
			msgTarget : 'side',
			labelAlign:'right',	//标签右对齐
			//blankText : '不能为空' ,
		},
		margin:5,
		border:false,
			items:[
			       {name:'name',fieldLabel:'姓名',},
			       {name:'ename',fieldLabel:'英文名',},			      
			       {xtype:'hidden',name:'photo'},
			    	        {
			    	   xtype:'filefield',name:'photo1',
			    	  fieldLabel:'头像', buttonText: '选择图片...',labelSeparator : ": ",
			    	   emptyText :'请选择上传的图片',
			    	        },			       
			       {
			    	   xtype:'numberfield',
			    	   name:'age',
			    	   fieldLabel:'年龄',
			    	   value: 25,
			           maxValue: 99,
			           minValue: 1,
			           editable: false,
			    	},
			       {name:'address',fieldLabel:'地址',},
			       {
			    	   xtype:'combo',
			    	   name:'department',
			    	   fieldLabel:'部门',
			    	   queryMode: 'remote',
				       store: 'dept.SelectStore',				       
				       displayField: 'name',
				       valueField: 'id',
				   },	
			       {xtype: 'datefield',name:'birthday',fieldLabel:'生日',value: null,format : 'Y-m-d'},		       
			       {name:'sid',fieldLabel:'工号',},
			       {name:'tel',fieldLabel:'电话',},
			       {name:'email',fieldLabel:'邮箱',},
			       {
			    	   xtype:'combo',
			    	   name:'area',
			    	   fieldLabel:'户籍',
			    	   queryMode: 'remote',
				       store: 'AreaSelectStore',
				       
				       displayField: 'name',
				       valueField: 'area',
				   },				       
			       {xtype: 'datefield',name:'stime',fieldLabel:'入职时间',value: new Date(),format : 'Y-m-d' },
			       {xtype: 'datefield',name:'etime',fieldLabel:'离职时间',value: null,format : 'Y-m-d'},
			       {name:'position',fieldLabel:'职位',},		       
			       {xtype: 'datefield',name:'rtime',fieldLabel:'转正时间',value: null,format : 'Y-m-d'},
			       {
			    	   xtype : 'fieldcontainer',defaultType: 'radiofield',name:'sex',fieldLabel:'性别',defaults: {
		                flex: 0
		            },layout: 'hbox',
		            items: [
		                    {
		                        boxLabel  : '男',
		                        name      : 'sex',
		                        inputValue: 1,
		                        id        : 'male'
		                    }, {
		                        boxLabel  : '女',
		                        name      : 'sex',
		                        inputValue: 0,
		                        id        : 'female'
		                    },
		                ]
			       },
			],
			 
		 
		        
		},
		 buttonAlign : "center",
	      buttons : [{
	          text : "提交",
	        action : "add",	  
	         },],

	initComponent:function(){//初始化方法
		this.callParent(arguments);
		
	}
});